﻿<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>中南大学自动化学院模型管理平台</title>
  <link rel="icon" type="image/x-icon" href="./favicon.ico" />
  <script type="text/javascript">
    // 检测浏览器版本
    (function () {
      var version = ieVer();
      if (version < 9) {
        location.href = "./static/version.html";
      }
      function ieVer() {
        var userAgent = navigator.userAgent;
        var isOpera = userAgent.indexOf("Opera") > -1;
        var isIE =
          userAgent.indexOf("compatible") > -1 &&
          userAgent.indexOf("MSIE") > -1 &&
          !isOpera;
        if (isIE) {
          var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
          reIE.test(userAgent);
          var IEVersion = parseFloat(RegExp["$1"]);
          return Math.floor(IEVersion);
        }

        return Infinity;
      }
    })();
  </script>
  <link type="text/css" rel="stylesheet" href="./css/reset.css" />

  <script>
    var now = new Date().getTime();
    document.write(
      '<link href="./css/index2.css?v=' +
      now +
      '" rel="stylesheet" type="text/css"/>' +
      '<link href="./css/login.css?v=' +
      now +
      '" rel="stylesheet" type="text/css"/>'
    );
  </script>
  <script type="text/javascript" src="./js/jquery-2.0.3.min.js"></script>
  <script type="text/javascript" src="./js/vue.min.2.5.13.js"></script>
  <script src="./js/login.js"></script>
  <script src="./js/utils.js"></script>
  <script src="./js/jquery.zxxbox.3.0-min.js"></script>
  <script src="./js/jquery.placeholder.js"></script>
</head>

<body style="background-color: #f9f9f9;">
  <div id="_app">
    <div id="top">
      <div class="wid">
        <div id="logo">
          <a href="./index.html"></a>
          <h1>
            <a href="./index.html" style="font-size: 18px;">自动化学院模型管理平台</a>
          </h1>
        </div>
        <div id="nav">
          <ul id="app">
            <li>
              <img src="./images/yishoulu.png" alt="" class="left" />
              <div class="right">
                <span class="num">{{statistics.projectSum}}</span><span class="name">已收录数据</span>
              </div>
            </li>
            <li>
              <img src="./images/shuju.png" alt="" class="left" />
              <div class="right">
                <span class="num">{{statistics.todaySum}}</span><span class="name">今日收录</span>
              </div>
            </li>
            <li>
              <img src="./images/chaxun.png" alt="" class="left" />
              <div class="right">
                <span class="num">{{statistics.browseSum}}</span><span class="name">总浏览量</span>
              </div>
            </li>
          </ul>
        </div>
        <div id="logoright">
          <div id="nologinbox">
            <a href="./login.html" class="on" rel="nofollow">登录</a><span>|</span><a href="./reg.html"
              rel="nofollow">注册</a>
          </div>
        </div>
        <div class="clear"></div>
      </div>
    </div>
    <div class="wid wid2">
      <div id="regbox">
        <div id="regleft">
          <a href="javascript:;" target="_blank"><img src="https://www.jisuapi.com/static/images/advip.png" alt="新版全新上线"
              style="width: 600px; height: 370px;" /></a>
        </div>
        <div id="regright">
          <h1 style="color: #dcdcdc; font-size: 16px;">
            <a id="numlogin" href="javascript:void(0);" class="on" style="margin-right: 0;">账号登录</a>
            <!-- <a id="numlogin" href="javascript:void(0);" class="on"
                  >账号登录</a
                >|<a id="codelogin" href="javascript:void(0);">扫码登录</a> -->
          </h1>
          <form id="numbox">
            <div class="formline">
              <div class="labelright">
                <input type="text" name="mobile" class="roundinput" id="mobile" placeholder="请输入手机号" />
              </div>
              <!--<div class="flhint" id="mobilehint"></div>-->
            </div>
            <div class="formline">
              <div class="labelright">
                <input type="password" class="roundinput" id="password" placeholder="请输入密码" />
              </div>
              <!--<div class="flhint" id="passwordhint"></div>-->
            </div>
            <div class="formline" id="autologinline">
              <!-- <label class="checkbox-group" id="checkboxgroup1">
                      <input type="checkbox" name="autologin" value="1" checked="checked" />
                      <span>两周内自动登录</span>
                    </label> -->
              <!-- <a href="forget" class="bluea" id="forgeta">忘记密码</a> -->
            </div>
            <div class="formline">
              <input type="hidden" name="fromurl" id="fromurl" value="" />
              <input type="button" class="btn" id="regbtn" value="用户登录" />
            </div>
            <div class="formline mcenter" id="regrbotline">
              还没有帐号？<a href="./reg.html" class="bluea">立即注册</a>
            </div>
          </form>
          <dl id="codebox">
            <dt>
              <img
                src="https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQHQ7zwAAAAAAAAAAS5odHRwOi8vd2VpeGluLnFxLmNvbS9xLzAydkFrNHhQcWM4bFQxMU5EMzF2Y0QAAgQxJgNfAwRAAQAA"
                alt="" />
            </dt>
            <dd>
              <p>请使用 <span>微信</span> <br />扫描二维码登录</p>
            </dd>
          </dl>
        </div>
        <div class="clearfix"></div>
      </div>
    </div>
    <script type="text/javascript">
      $(function () {
        var userCode = Hu.Cookies.get("HuUserName");

        if (userCode) {
          $("#mobile").val(userCode);
        }
        $("#numlogin").addClass("on");
        $("#regright h1").on("click", "a", function () {
          $(this).addClass("on").siblings().removeClass("on");
          if ($(this).attr("id") == "numlogin")
            $("#numbox").show().siblings("#codebox").hide();
          else {
            $("#codebox").show().siblings("#numbox").hide();
            var timer = setInterval(function () {
              $.ajax({
                type: "get",
                url: "/my/login?act=wxlogin&scene=jIV0SIYw",
                success: function (data) {
                  var data = JSON.parse(data);
                  if (data.status == 0) {
                    clearInterval(timer);
                    window.location.reload();
                    return;
                  }
                  if (data.status == 2) {
                    $.hqbox.remind(data.msg, null, {
                      title: "提示",
                      drag: true,
                      bg: false,
                      delay: 3000,
                    });
                    clearInterval(timer);
                    return;
                  }
                },
              });
            }, 2000);
          }
        });
      });
      function isEmail(val) {
        var reg = /^([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+.[a-zA-Z]{2,4}$/;
        return reg.test(val);
      }
      function isMobile(val) {
        var reg = /^1[3456789]\d{9}$/;
        var reg2 = /^852\d{8}$/;
        return reg.test(val) || reg2.test(val);
      }
      $("#email")
        .on("focus", function () {
          $(this).parent().removeClass("has-error");
          //$("#emailhint").removeClass('green').addClass('red').html('');
        })
        .on("blur", function () {
          var email = $.trim($(this).val());
          if (email == "") {
            $(this).parent().removeClass("has-error");
          } else if (!isEmail(email)) {
            $(this).parent().addClass("has-error");
            //$("#emailhint").removeClass('green').addClass('red').html('Email有误');
          } else {
            //$("#emailhint").removeClass('red').addClass('green').html('√');
          }
        });
      $("#mobile")
        .on("focus", function () {
          $(this).parent().removeClass("has-error");
          //$("#mobilehint").removeClass('green').addClass('red').html('*');
        })
        .on("blur", function () {
          var mobile = $.trim($(this).val());
          if (!isMobile(mobile)) {
            $(this).parent().addClass("has-error");
            //$("#mobilehint").removeClass('green').addClass('red').html('手机号有误');
          } else {
            //$("#mobilehint").removeClass('red').addClass('green').html('√');
          }
        });
      $("#password")
        .on("focus", function () {
          $(this).parent().removeClass("has-error");
          $("#passwordhint")
            .removeClass("green")
            .html('<span class="red">*</span>');
        })
        .on("blur", function () {
          var password = $.trim($(this).val());
          if (password.length < 6) {
            $(this).parent().addClass("has-error");
            //$("#passwordhint").removeClass('green').html('<span class="red">*</span>');
          } else {
            //$("#passwordhint").addClass('green').html('√');
          }
        });
      $("#regbtn").on("click", function () {
        console.log($.zxxbox)
        if ($(".has-error").length > 0) return false;
        var email = $.trim($("#email").val());
        var password = $.trim($("#password").val());
        var mobile = $.trim($("#mobile").val());
        var apiUrl = window.location.href.indexOf('127.0.0.1') > -1 ? 'http://39.106.120.139' : '';
        $.get(
          apiUrl + "/ProjectApi/Login",
          // "http://39.106.120.139/ProjectApi/Login",
          { pwd: password, name: mobile },
          function (data, status) {
            console.log(data)
            if (data.code == 1 && data.msg == '登陆成功') {
              var fromurl = $("#fromurl").val();
              if (!fromurl) fromurl = "/my/";
              Hu.Cookies.set('HuUserName', mobile,)
              Hu.Cookies.set('HuUserID', data.user_id)
              document.location = './index.html';
            } else {
              $.zxxbox.remind(data.msg, null, {
                title: "提示",
                drag: true,
                bg: false,
                delay: 3000,
              });
            }
          },
          "json"
        );
      });

      $(document).keydown(function (event) {
        var ev = event || window.event;
        var code = ev.keyCode || ev.which || ev.charCode;
        if (code == 13) {
          $("#regbtn").click();
        }
      });

      $(":text,:password").placeholder();
    </script>
  </div>
  <div class="wid" id="foot2">
    <div class="wid2">
      <p class="clear mtop15 mcenter">© 2020-
        <script>
          var year = new Date().getFullYear();
          document.write(year);
        </script> <a href="http://soa.csu.edu.cn/" target="_blank" style="color:#999;display: inline;">中南大学自动化学院</a>
        版权所有 <span>　<a href="http://www.beian.miit.gov.cn" target="_blank"
            style="color:#999;display: inline;">湘ICP备05005659号-1 </a>　湘教QS3-200505-000204
        </span></p>
    </div>
  </div>
</body>

</html>